<@html>
<script type="text/javascript">
	dojo.require("dijit.dijit");
	dojo.require("dijit.form.Form");
	dojo.require("dijit.form.NumberTextBox");
	dojo.require("dijit.form.DateTextBox");
	dojo.require("dijit.form.Button");
	dojo.require("dijit.form.ValidationTextBox");
	dojo.require("dijit.form.CheckBox");
</script>
<form id="updateForm" method="post" dojoType="dijit.form.Form">
<input type="hidden" id="version" name="location.version"
       value="${(location.version)!}"/>
<input type="hidden" id="location" name="location.id"
       value="${(location.id)!}"/>
<table>
<tr>
	<td>
	<@s.text name="locCode"/>：
	</td>
	<td>
		<input id="locCode" name="location.locCode" dojoType="dijit.form.ValidationTextBox"
		       value="${(location.locCode)!}"/>
	</td>
	<td>
	<@s.text name="locUse"/>：
	</td>
	<td>
		<input id="locUse" name="location.locUse" dojoType="dijit.form.ValidationTextBox"
		       value="${(location.locUse)!}"/>
	</td>
	<td>
	<@s.text name="locType"/>：
	</td>
	<td>
		<input id="locType" name="location.locType" dojoType="dijit.form.ValidationTextBox"
		       value="${(location.locType)!}"/>
	</td>
</tr>
<tr>
	<td>
	<@s.text name="locPro"/>：
	</td>
	<td>
		<input id="locPro" name="location.locPro" dojoType="dijit.form.ValidationTextBox"
		       value="${(location.locPro)!}"/>
	</td>
	<td>
	<@s.text name="locIn"/>：
	</td>
	<td>
		<input id="locIn" name="location.locIn" dojoType="dijit.form.ValidationTextBox" value="${(location.locIn)!}"/>
	</td>
	<td>
	<@s.text name="locOut"/>：
	</td>
	<td>
		<input id="locOut" name="location.locOut" dojoType="dijit.form.ValidationTextBox"
		       value="${(location.locOut)!}"/>
	</td>
</tr>
<tr>
	<td>
	<@s.text name="maxWeight"/>：
	</td>
	<td>
		<input id="maxWeight" name="location.maxWeight" dojoType="dijit.form.ValidationTextBox"
		       value="${(location.maxWeight)!}"/>
	</td>
	<td>
	<@s.text name="maxVolume"/>：
	</td>
	<td>
		<input id="maxVolume" name="location.maxVolume" dojoType="dijit.form.ValidationTextBox"
		       value="${(location.maxVolume)!}"/>
	</td>
	<td>
	<@s.text name="maxArea"/>：
	</td>
	<td>
		<input id="maxArea" name="location.maxArea" dojoType="dijit.form.ValidationTextBox"
		       value="${(location.maxArea)!}"/>
	</td>
</tr>
<tr>
	<td>
	<@s.text name="availableWeight"/>：
	</td>
	<td>
		<input id="availableWeight" name="location.availableWeight" dojoType="dijit.form.ValidationTextBox"
		       value="${(location.availableWeight)!}"/>
	</td>
	<td>
	<@s.text name="availableVolume"/>：
	</td>
	<td>
		<input id="availableVolume" name="location.availableVolume" dojoType="dijit.form.ValidationTextBox"
		       value="${(location.availableVolume)!}"/>
	</td>
	<td>
	<@s.text name="availableArea"/>：
	</td>
	<td>
		<input id="availableArea" name="location.availableArea" dojoType="dijit.form.ValidationTextBox"
		       value="${(location.availableArea)!}"/>
	</td>
</tr>
<tr>
	<td>
	<@s.text name="locationLength"/>：
	</td>
	<td>
		<input id="locationLength" name="location.locationLength" dojoType="dijit.form.ValidationTextBox"
		       value="${(location.locationLength)!}"/>
	</td>
	<td>
	<@s.text name="locationWidth"/>：
	</td>
	<td>
		<input id="locationWidth" name="location.locationWidth" dojoType="dijit.form.ValidationTextBox"
		       value="${(location.locationWidth)!}"/>
	</td>
	<td>
	<@s.text name="locationHeight"/>：
	</td>
	<td>
		<input id="locationHeight" name="location.locationHeight" dojoType="dijit.form.ValidationTextBox"
		       value="${(location.locationHeight)!}"/>
	</td>
</tr>
<tr>
	<td>
	<@s.text name="xcoord"/>：
	</td>
	<td>
		<input id="xcoord" name="location.xcoord" dojoType="dijit.form.ValidationTextBox"
		       value="${(location.xcoord)!}"/>
	</td>
	<td>
	<@s.text name="ycoord"/>：
	</td>
	<td>
		<input id="ycoord" name="location.ycoord" dojoType="dijit.form.ValidationTextBox"
		       value="${(location.ycoord)!}"/>
	</td>
	<td>
	<@s.text name="zcoord"/>：
	</td>
	<td>
		<input id="zcoord" name="location.zcoord" dojoType="dijit.form.ValidationTextBox"
		       value="${(location.zcoord)!}"/>
	</td>
</tr>
<tr>
	<td>
	<@s.text name="level"/>：
	</td>
	<td>
		<input id="level" name="location.level" dojoType="dijit.form.NumberTextBox" value="${(location.level)!}"/>
	</td>
	<td>
	<@s.text name="remark"/>：
	</td>
	<td>
		<input id="remark" name="location.remark" dojoType="dijit.form.ValidationTextBox"
		       value="${(location.remark)!}"/>
	</td>
	<td>
	<@s.text name="isJump"/>：
	</td>
	<td>
	<@checkbox id="isJump" name="location.isJump" value=location.isJump/>
	</td>
</tr>
<tr>
	<td>
	<@s.text name="locGid"/>：
	</td>
	<td>
		<input id="locGid" name="location.locGid" dojoType="dijit.form.ValidationTextBox"
		       value="${(location.locGid)!}"/>
	</td>
	<td>
	<@s.text name="udf1"/>：
	</td>
	<td>
		<input id="udf1" name="location.udf1" dojoType="dijit.form.ValidationTextBox" value="${(location.udf1)!}"/>
	</td>
	<td>
	<@s.text name="udf2"/>：
	</td>
	<td>
		<input id="udf2" name="location.udf2" dojoType="dijit.form.ValidationTextBox" value="${(location.udf2)!}"/>
	</td>
</tr>
<tr>
	<td>
	<@s.text name="udf3"/>：
	</td>
	<td>
		<input id="udf3" name="location.udf3" dojoType="dijit.form.ValidationTextBox" value="${(location.udf3)!}"/>
	</td>
	<td>
	<@s.text name="udf4"/>：
	</td>
	<td>
		<input id="udf4" name="location.udf4" dojoType="dijit.form.ValidationTextBox" value="${(location.udf4)!}"/>
	</td>
	<td>
	<@s.text name="udf5"/>：
	</td>
	<td>
		<input id="udf5" name="location.udf5" dojoType="dijit.form.ValidationTextBox" value="${(location.udf5)!}"/>
	</td>
</tr>
<tr>
	<td>
	<@s.text name="udf6"/>：
	</td>
	<td>
		<input id="udf6" name="location.udf6" dojoType="dijit.form.ValidationTextBox" value="${(location.udf6)!}"/>
	</td>
	<td>
	<@s.text name="udf7"/>：
	</td>
	<td>
		<input id="udf7" name="location.udf7" dojoType="dijit.form.ValidationTextBox" value="${(location.udf7)!}"/>
	</td>
	<td>
	<@s.text name="udf8"/>：
	</td>
	<td>
		<input id="udf8" name="location.udf8" dojoType="dijit.form.ValidationTextBox" value="${(location.udf8)!}"/>
	</td>
</tr>
<tr>
	<td>
	<@s.text name="udf9"/>：
	</td>
	<td>
		<input id="udf9" name="location.udf9" dojoType="dijit.form.ValidationTextBox" value="${(location.udf9)!}"/>
	</td>
	<td>
	<@s.text name="udf10"/>：
	</td>
	<td>
		<input id="udf10" name="location.udf10" dojoType="dijit.form.ValidationTextBox" value="${(location.udf10)!}"/>
	</td>
	<td>
	<@s.text name="udf11"/>：
	</td>
	<td>
		<input id="udf11" name="location.udf11" dojoType="dijit.form.ValidationTextBox" value="${(location.udf11)!}"/>
	</td>
</tr>
<tr>
	<td>
	<@s.text name="udf12"/>：
	</td>
	<td>
		<input id="udf12" name="location.udf12" dojoType="dijit.form.ValidationTextBox" value="${(location.udf12)!}"/>
	</td>
	<td>
	<@s.text name="udf13"/>：
	</td>
	<td>
		<input id="udf13" name="location.udf13" dojoType="dijit.form.DateTextBox" value="${getDate(location.udf13)}"
		       value="${(location.udf13)!}"/>
	</td>
	<td>
	<@s.text name="udf14"/>：
	</td>
	<td>
		<input id="udf14" name="location.udf14" dojoType="dijit.form.DateTextBox" value="${getDate(location.udf14)}"
		       value="${(location.udf14)!}"/>
	</td>
</tr>
<tr>
	<td>
	<@s.text name="udf15"/>：
	</td>
	<td>
		<input id="udf15" name="location.udf15" dojoType="dijit.form.DateTextBox" value="${getDate(location.udf15)}"
		       value="${(location.udf15)!}"/>
	</td>
	<td>
	<@s.text name="udf16"/>：
	</td>
	<td>
		<input id="udf16" name="location.udf16" dojoType="dijit.form.DateTextBox" value="${getDate(location.udf16)}"
		       value="${(location.udf16)!}"/>
	</td>
	<td>
	<@s.text name="udf17"/>：
	</td>
	<td>
		<input id="udf17" name="location.udf17" dojoType="dijit.form.DateTextBox" value="${getDate(location.udf17)}"
		       value="${(location.udf17)!}"/>
	</td>
</tr>
<tr>
	<td>
	<@s.text name="udf18"/>：
	</td>
	<td>
		<input id="udf18" name="location.udf18" dojoType="dijit.form.DateTextBox" value="${getDate(location.udf18)}"
		       value="${(location.udf18)!}"/>
	</td>
</tr>
</table>
<div dojoType="dijit.layout.TabContainer" style="width:100%;height:300px;">
	<div dojoType="dijit.layout.ContentPane" title="库位组">
		<link rel="stylesheet" href="${(path)!}/js/dojo/dojox/grid/resources/${(theme)!}Grid.css">
		<script language="javascript" type="text/javascript">
			dojo.require("dojox.grid.DataGrid");
			dojo.require("dojox.grid._CheckBoxSelector");
			dojo.require("dojo.data.ItemFileWriteStore");
		</script>
		<div id="locationGrounp" autoHeight="true" style="width: 100%;"
		     dojoType="dojox.grid.DataGrid" singleClickEdit="true" structure="locationGrounp_structure"
		     store="locationGrounp_store">
		</div>
		<div style="width:100%; text-align:center;">
			<input type="button" id="addLocationGrounp" value="增加" class="addRow"/>
			<input type="button" id="deleteLocationGrounp" value="删除" class="deleteRow"/>
		</div>
		<script type="text/javascript" language="javascript">
			var locationGrounp_store = new dojo.data.ItemFileWriteStore({
						data:{
							identifier:"id",
							label:"name",
							items:[
								<#list location.locationGrounp![] as item >
									<#if (item_index > 0)>,</#if>
									{
										"id":"${(item.id)!}"
										,"code": "${(item.code)!}"
										,"name": "${(item.name)!}"
										,"remark": "${(item.remark)!}"
									}
								</#list>
							]
						}
					});
			var locationGrounp_structure = [
				{ type: "dojox.grid._CheckBoxSelector"}
				,
				{cells:[
					[
						new dojox.grid.cells.RowIndex({ width:"2",name:""}),
						{
							"name" : "<@s.text name="code"/>"
							,"field" : "code"
							,"width" :"33%"
							,"editable" : true
							,"headerClasses" : "gridHeader"
						}
						,{
						"name" : "<@s.text name="name"/>"
						,"field" : "name"
						,"width" :"33%"
						,"editable" : true
						,"headerClasses" : "gridHeader"
					}
						,{
						"name" : "<@s.text name="remark"/>"
						,"field" : "remark"
						,"width" :"33%"
						,"editable" : true
						,"headerClasses" : "gridHeader"
					}
					]
				]
				}
			];
			var locationGrounp_index = 0;
			//新增行按钮
			dojo.connect(dojo.byId("addLocationGrounp"), "click", function() {
				locationGrounp_store.newItem({
							"id" : locationGrounp_index
							,"code": ""
							,"name": ""
							,"remark": ""
						});
				locationGrounp_index++;
			})
			//删除行按钮
			dojo.connect(dojo.byId("deleteLocationGrounp"), "click", function() {
				dijit.byId("locationGrounp").removeSelectedRows();
			})
		</script>
	</div>
</div>
<@listButton/>
</form>
</@html>
<script language="javascript" type="text/javascript">
	dojo.ready(function() {
		//事件注册
		//保存
		dojo.connect(dijit.byId("btnSave"), "onClick", function() {
			//增加列表参数
			var param = dojo.formToObject("updateForm");
			dojo.safeMixin(param, storeItemToParam(locationGrounp_store, "location.locationGrounp"));
			if (dijit.byId("updateForm").validate()) {
				dojo.xhrPost({
							url : "${(path)!}/master/location.update.do",
							content : param,
							handleAs : "json",
							load : function(json) {
								handleJsonMessage({
											message:json,
											callback:function() {
												parent.publish("location/refresh");
												parent.closeDialog();
											}
										})
							}
						});
			}
		});
	})
</script>
